<template>
  <div class="database-config">
    <div class="form-item">
      <span class="label-text">名称</span>
      <a-input v-model:value="dbName" placeholder="输入数据库名称" />
    </div>

    <div class="form-item">
      <span class="label-text">地址</span>
      <a-input v-model:value="dbIP" placeholder="输入数据库IP"> </a-input>
    </div>

    <div class="form-item">
      <span class="label-text">端口</span>
      <a-input v-model:value="dbPort" placeholder="输入端口"> </a-input>
    </div>

    <div class="form-item">
      <span class="label-text">密码</span>
      <a-input-password v-model:value="dbPassword" placeholder="输入密码">
        <template #prefix>
          <lock-outlined />
        </template>
      </a-input-password>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { ref } from "vue";
import {
  EnvironmentOutlined,
  NumberOutlined,
  LockOutlined,
} from "@ant-design/icons-vue";

const dbName = ref<string>("");
const dbIP = ref<string>("");
const dbPort = ref<string>("");
const dbPassword = ref<string>("");
</script>

<style scoped>
.database-config {
  max-width: 400px;
  margin: 0 auto;
  padding: 20px;
  border: 1px dashed #d9d9d9;
  border-radius: 8px;
  background-color: #fefefeb0;
}

.form-item {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.label-text {
  width: 100px;
  font-weight: 400;
  font-size: 14px;
  margin-right: 20px;
}

a-input,
a-input-password {
  flex: 1;
}
</style>
